// ProjectMonitor.cpp : implementation file
//

#include "stdafx.h"
#include "assit.h"
#include "ProjectMonitor.h"


// CProjectMonitor

CProjectMonitor::CProjectMonitor()
{
}

CProjectMonitor::~CProjectMonitor()
{
}


BOOL CProjectMonitor::printSum()
{
	for(int i=0; i<m_project.GetCount(); i++)
	{
		CItem item = m_project.GetAt(i);
		CString sInfo;
		sInfo.Format(L"workdays	currentProgress	currentDay	estimatedProgress	extraDay\n");
		OutputDebugString(sInfo);

		float estimatedProgress = ((float)item.currentDay/item.workDays)* 100;
		float extraDay = item.workDays*((100-item.currentProgress)/100.0f) - item.workDays*((100-estimatedProgress)/100.0f);

		sInfo.Format(L"%dd	%.2f%%	%d	%.2f%%	%.2fd", item.workDays, item.currentProgress, item.currentDay, estimatedProgress,
			extraDay);

		OutputDebugString(sInfo);
	}
	return TRUE;
}

// CProjectMonitor member functions
